package Si.Assign1.Model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name="ProductTypes")
@NamedQueries(
     {
    @NamedQuery(name="listProductTypes",
                query="SELECT pt FROM ProductTypes pt"),
    @NamedQuery(name="getProductTypesById",
                query="SELECT pt FROM ProductTypes pt WHERE pt.id = :id"),
    @NamedQuery(name="getProductTypesByName",
                query="SELECT pt FROM ProductTypes pt WHERE pt.name = :name")
     }
		)

public class ProductTypes 
{
	public ProductTypes(){}

	/*
	 * Properties
	 */
	
	/*
	 * Set and get id
	 */
	public int getId()
	{   return id;    }
	public void setId(int id)
	{   this.id = id; }
	
	/*
	 * Set and get name
	 */
	public String getName()
	{   return name;   }
	public void setName(String name)
	{   this.name = name; }
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Basic(optional=false)
	@Column(name="id", nullable=false)
	private int id;
	@Column(name="name", length=255, nullable=false)
	private String name;

}
